<!--时间：2018-07-10 11:21:22
	作者：HQS
	描述：贴吧电竞 主页
-->
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>电竞首页</title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link rel="icon" href="img/favicon.ico" mce_href="http://pd51ux91p.bkt.clouddn.com/favicon.ico" type="image/x-icon">
	<link rel="stylesheet" type="text/css" href="css/commonality.css"/>
	<link rel="stylesheet" type="text/css" href="css/swiper.min.css"/>
	<link rel="stylesheet" type="text/css" href="css/index1.css"/>
	<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/layer.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
	<div class="pc" style="display: none;">
		<!--头部导航菜单-->
		<div class="top">
			<div class="top_div">
				<a class="logo" href="index.html"><img src="http://pd51ux91p.bkt.clouddn.com/public/logo.png"/></a>
				<ul><li><a href="index.html">首页</a></li>
					<li><a href="game.html">游戏</a></li>
					<li><a href="edg.html">战队</a></li>
					<li><a href="guide.html">办赛指南</a></li>
					<li><a href="userCenter.html">注册/登录</a></li>
					<li><a href="javascript:;">创建战队</a></li>
				</ul>
			</div>
		</div>
		
		<!--主体-->
		<div class="main dis_block">

			<!--顶部轮播海报-->
			<div class="banner">
				<div class="banner_bg banner_bg1"></div>
				<div class="banner_bg banner_bg2"></div>
				<div class="banner_bg banner_bg3"></div>
				<div class="banner_bg banner_bg4"></div>
				<div class="banner_bg banner_bg5"></div>
			</div>
			
			<!--游戏列表-->
			<div class="GamesList">
				<div class="GamesList_div">
					
				</div>
			</div>
			
			<!--时事-->
			<div class="content" id="ambassador">
				<div class="content_div">
					<!--热门赛事-->
					<div class="PopularEvents">
						
					</div>
					<!--新闻资讯-->
					<div class="news">
						
					</div>
				</div>
			</div>
		
			<!--榜单-->
			<div class="crunchies">
				<div class="crunchies_div">
					<!--战队榜-->
					<div class="edg">
						
					</div>
					<!--赛事榜-->
					<div class="Competition">
						
					</div>
				</div>
			</div>
			
			
			
			
			
			<!--联系我们-->
			<div class="about" id="about">
				<div class="about_main">
					<p class="about_title">联系我们</p>
					<p class="about_describe">我们总是乐于帮助你，请选择最适合你的方式联系我们！ </p>
					<div class="about_address">
						<p style="margin-top: 8px;">总址：上海市闵行区虹井路288号B座703室</p>
						<p>分部：广州市天河区广州信息港方圆E时光西座28楼</p>
						<p>邮编：510000</p>
						<p>电话：+86 13901779476</p>
						<p>&nbsp;</p>
						<p>网址：www.juyouxiao.com</p>
						<p>E-mail：hr@tianchangtech.com</p>
					</div>
					
					
					<div class="toastInfo"><span>提醒</span></div>
				</div>
				<ul class="foot">
					<li><a href="index.html">首页</a></li>
					<li><a href="javascript:;">校园大使</a></li>
					<li><a href="javascript:;">关于我们</a></li>
				</ul>
				<p class="provider">京公网安备11010802023605号</p>
			</div>
		</div>
		
		<!--点击回到顶部-->
		<a id="com_d" style="display: none;"></a>
	</div>
	
	<div class="mobile" style="display: block;">
		<!--从别的吧进入  看到的导航-->
		<div class="topNav">
			<ul><li class="avtie"><a href="index.html">首页</a></li>
				<li><a href="edg.html">战队</a></li>
				<li><a  id="_Usercente">我的</a></li>
			</ul>
		</div>
		
		<!--底部 导航 菜单-->
		<div class="top">
			<ul><li class="avtie">
					<a href="index.html">
						<img src="http://pd51ux91p.bkt.clouddn.com/public/icon_navigation_11.png"/>
						<p>首页</p>
					</a>
				</li>
				<li><a href="javascript:;">
						<img src="http://pd51ux91p.bkt.clouddn.com/public/icon_navigation_2.png"/>
						<p>看帖</p>
					</a>
				</li>
				<li><a href="javascript:;"><img class="increase" src="http://pd51ux91p.bkt.clouddn.com/public/icon_navigation_3.png"/></a></li>
				<li><a href="edg.html">
						<img src="http://pd51ux91p.bkt.clouddn.com/public/icon_navigation_4.png"/>
						<p>战队</p>
					</a>
				</li>
				<li><a  id="_Usercenter">
						<img src="http://pd51ux91p.bkt.clouddn.com/public/icon_navigation_5.png"/>
						<p>我的</p>
					</a>
				</li>
			</ul>
		</div>
		
		<!--顶部海报-->
		<div class="banner">
			<div class="swiper-container" id="bannerSwiper">
				<div class="swiper-wrapper"></div>
				<ul class="pagination" id="bannerpagination"></ul>
			</div>
		</div>
		
		<!--所有游戏-->
		<div class="AllGames shadow fix">
			<p class="contentHeader"><img src="http://pd51ux91p.bkt.clouddn.com/public/icon_1.png"/>所有游戏</p>
			<div class="content fix">
				<a class="button AllGamesButton dis_none" href="allgame.html">…</a>
			</div>
		</div>
		
		<!--当前赛事-->
		<div class="TheCurrentEvent shadow fix">
			<p class="contentHeader"><img src="http://pd51ux91p.bkt.clouddn.com/public/icon_2.png"/>当前赛事</p>
			<div class="calendar fix">
				<div class="calendar_top">
					<p class="MONTH"></p>
					<div class="module">
						<div class="calendar_left"><a class="Aleft" data-month="" data-addUp="" data-num="1" data-val="1" href="javascript:;"></a></div>
						<div class="calendar_middle">
							<div class="swiper-container" id="bannerSwiper2">
								<div class="swiper-wrapper"></div>
							</div>
							<div class="aperture"></div>
						</div>
						<div class="calendar_right"><a class="Aright" data-month="" data-addUp="" data-num="1" data-val="1" href="javascript:;"></a></div>
					</div>
				</div>
				<div class="calendar_bottom">
					<div class="indexModule">
						<a class="pullDown" href="javascript:;" data-switch="">
							<img class="imgClass imgClass1" src=""/>
							<p class="pClass" id="pClass"> </p>
							<span class="spanClass"></span>
						</a>
						<div class="EventList dis_none"></div>
					</div>
				</div>
			</div>
			<!-- 赛事安排 -->
			<div class="content fix" id="arrangement"></div>
		</div>
		
		<!--热门赛事-->
		<div class="PopularEvents shadow fix">
			<p class="contentHeader"><img src="http://pd51ux91p.bkt.clouddn.com/public/icon_3.png"/>热门赛事</p>
			<div class="content fix"></div>
		</div>
		
		<!--排行榜-->
		<div class="rankingList fix">
			<p class="contentHeader"><img src="http://pd51ux91p.bkt.clouddn.com/public/icon_4.png"/>排行榜</p>
			<div class="content fix">
				<div class="classify">
					<a class="Crunchies avter" id="TeamLIst" href="javascript:;">战队榜</a>
					<a class="Crunchies" id="ListOfEvents" href="javascript:;">赛事榜</a>
				</div>
				
				<!--战队榜-->
				<div class="TeamLIst">
					
					<!--无比赛-->
					<p class="noGame dis_none">暂无战事榜信息~</p>
				</div>
				
				<!--赛事榜-->
				<div class="EventsLIst dis_none">
					<div class="CrunchiesRanking fix">
					<!--无比赛-->
					
					</div>
				</div>
			</div>
		</div>
		
		<div class="navigation fix">
			<a class="" id="navButtonCollege" href="trainingInstitute.html"><img class="navButtonCollege" src="http://pd51ux91p.bkt.clouddn.com/index/navButtonCollege.png"/></a>
			<a class="" id="navButtonAttention" href="javascript:;"><img class="navButtonAttention" src="http://pd51ux91p.bkt.clouddn.com/index/navButtonAttention.png"/></a>
		</div>
	</div>
	
	<script src="js/sUserAgent.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/index1.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/swiper-3.4.2.min.js"></script>
	<script type="text/javascript">
		//循环首页 顶部  海报
		$.ajax({
		    url:"/api/carouselevent/",
		    type:"get",
		    data:{},
		    contentType:"application/json",
		    dataType:"json",
		    success:function(res){
		    	var html1 = '';
		    	var html2 = '';
		        if (res.code ==0 && res.datas.length>=0) {
	                $.each(res.datas,function(i,item){
	                	var _href = '';
	                   	if (item.type===1){
	                   		_href = "game.html?game_id="+item.car_e_id;
	                   	}else if (item.type===2){
	                   		_href = 'competition.html?event_id='+item.car_e_id;
	                   	}else{
	                   		_href = 'news.html?news_id='+item.car_e_id;
	                   	}
                   		html1+='<div class="swiper-slide"><a class="banner_con fix" href="'+_href+'"><img src="'+item.icon+'"/></a></div>';                        
	                });
	        		$("#bannerSwiper .swiper-wrapper").append(html1);	
	        	}else{
	        		for (var i = 1; i <= 4; i++) {
	        			html2 +='<div class="swiper-slide"><a class="banner_con fix" href="news.html"><img src="http://pd51ux91p.bkt.clouddn.com/banner'+i+'.jpg"/></a></div>';
	        		}
	        		$("#bannerSwiper .swiper-wrapper").append(html2);
	        	}
			}
		});
		//首页 顶部 海报  图片轮播
		var mySwiper = new Swiper('#bannerSwiper',{
				loop: true,//在原本slide前后复制若干个slide(默认一个)并在合适的时候切换，让Swiper看起来是循环的
				autoplay:3000,
				speed:3000,
		        autoplayDisableOnInteraction : false,
				pagination: '#bannerpagination',
				paginationClickable :true,//此参数设置为true时，点击分页器的指示点分页器会控制Swiper切换
				observer:true,//修改swiper自己或子元素时，自动初始化swiper
    			observeParents:true,//修改swiper的父元素时，自动初始化swiper
		});
	
	
		function GetQueryString(name) {
		     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		     var r = window.location.search.substr(1).match(reg);
		     if(r!=null)return  unescape(r[2]); return null;
		}
		var code = GetQueryString("code");
		var _type = 'baidu'
		var state = GetQueryString('state')
		if (state=='test'){
			_type = state
		}else if (state=='wx' || state=='wxpc'){
			_type = state
		}
		var auth_type = getCookie("yz_bing_auth");
		delCookie("yz_bing_auth");
		var yz_id =  getCookie("yz_id");
		var yz_tk = getCookie("yz_tk");
		if(auth_type!=null && code !=null){
			$.ajax({
			    url:"/api/bingauth/",
			    type:"post",
			    data:JSON.stringify({"type":auth_type,"code":code,"token":yz_tk,"user_id":yz_id}),
			    dataType:"json",
			    contentType:"application/json",
			    success:function(res){
			         if (res.code ==0) {
			         	delCookie("yz_bing_auth");
			         	layer.msg(res.msg)
			         }else{
			         	layer.msg(res.msg)
			         }
				}
			});			
		}
		if (code!=null && auth_type==null) {
			$.ajax({
			    url:"/api/authlogin/",
			    type:"post",
			    data:JSON.stringify({"type":_type,"code":code}),
			    dataType:"json",
			    contentType:"application/json",
			    success:function(res){
			         if (res.code ==0) {
			         	setCookie('yz_tk',res.token)
			         	setCookie('yz_id',res.user_id)
			         }
				}
			});
			
		}
		if (window.location.host=='admin.con.com'  && getUrlParms('user_id')!=null){

			$.ajax({
			    url:"/api/user/",
			    type:"get",
			    data:{"user_id":getUrlParms('user_id')},
			    dataType:"json",
			    contentType:"application/json",
			    success:function(res){
		         	console.log(res)
		         	setCookie('yz_tk',res.token)
		         	setCookie('yz_id',res.user_id)
				}
			});			
		}
	</script>
</body>
</html>

